
<script>
    function getWeekNumber(d) {
	d = new Date(d);
	d.setHours(0,0,0);
	d.setDate(d.getDate() + 4 - (d.getDay()||7));
	var yearStart = new Date(d.getFullYear(),0,1);
	var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7);
	
	return weekNo + "/" + d.getFullYear();
    }
    
    function selectWeek(dateText, inst) {
	d = new Date(dateText);
	d.setHours(0,0,0);
	d.setDate(d.getDate() + 4 - (d.getDay()||7));
	var yearStart = new Date(d.getFullYear(),0,1);
	var weekNo = Math.ceil(( ( (d - yearStart) / 86400000) + 1)/7);
	$('#' + inst.id)[0].value = weekNo;
    }
    
    $(function() {
	$('#idAbgelehnt').datepicker({
	    dateFormat: 'yy'
	});
	$('#idFesterTermin').datepicker({
	    onSelect: selectWeek
	});
	$('#idChildWeek').datepicker({
	    onSelect: selectWeek
	});
	$('#idEmployeeWeek').datepicker({
	    onSelect: selectWeek
	});
	
    });
</script>
<table>
    <br><br>
    <caption>Berichte</caption>
   <tr>
	<td>
	    <form action="/report/abgelehnt" method="POST">
	    Alle abgelehnten Termine für das Jahr
	<td>
	   <input type="text" name="year" />
	</td>
	<td>
	    <input type="submit" />
	    </form>
	</td>
    </tr>
     <tr>
	<td>
	    <form action="/report/festerTermin" method="POST">
	    Alle festen Termine für die Kalenderwoche: 
	</td>
	<td>
	    <input type="text" name="week" />
	</td>
	<td>
	    <input type="submit" />
	    </form>
	</td>
    </tr>
    <tr>
	<td>
	    <form action="/report/childweek" method="POST">
	    Zu betreuende Kinder f&uuml;r die Kalenderwoche: 
	</td>
	<td>
	    <input type="text" name="week" />
	</td>
	<td>
	    <input type="submit" />
	    </form>
	</td>
    </tr>
    <tr>
	<td>
	    <form action="/report/employeeweek" method="POST">
	    Eingeteilte Betreuer f&uuml;r die Kalenderwoche: 
	</td>
	<td>
	    <input type="text" name="week" />
	</td>
	<td>
	    <input type="submit" />
	    </form>
	</td>
    </tr>
    <tr>
	<td>
	    <form action="/report/employeeavaiable" method="POST">
	    Verf&uuml;gbare Betreuer f&uuml;r die Kalenderwoche: 
	</td>
	<td>
	    <input size="8" type="text" name="week" value="<?php echo date("W"); ?>" />
	     <input size="8" type="text" name="year" value="<?php echo date("Y"); ?>" />
	</td>
	<td>
	    <input type="submit" />
	    </form>
	</td>
    </tr>
    <tr>
	<td>
	    <form action="/report/monthly" method="POST">
	    Monats-Report f&uuml;r Jahr: 
	</td>
	<td>
	    <input type="text" name="year" />
	</td>
	<td>
	    <input type="submit" />
	    </form>
	</td>
    </tr>
    <tr>
	<td>
	    <form action="/report/employee" method="POST">
	    Mitarbeiter-Monats-Report f&uuml;r Jahr:
	</td>
	<td>
	    <input type="text" name="year" /> 
	</td>
	<td>
	    <input type="submit" />
	    </form>
	</td>
    </tr>
</table>
